package com.yswee.framework.widget.base;

import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
import android.widget.ScrollView;

public class MScrollView extends ScrollView {
	
	private Handler mHandler;

	public MScrollView(Context context) {
		super(context);
	}

	
	public MScrollView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public void scrollToTop() {
		if(mHandler == null) {
			mHandler = new Handler();
		}
		mHandler.post(new Runnable() {
			@Override
			public void run() {
				fullScroll(FOCUS_UP);
			}
		});
	}
	
	public void scrollToBottom() {
		if(mHandler == null) {
			mHandler = new Handler();
		}
		mHandler.post(new Runnable() {
			@Override
			public void run() {
				fullScroll(FOCUS_DOWN);
			}
		});
	}
	
}
